﻿using System.Diagnostics;

namespace Fujitsu.JiraAnalysis.Common
{
    public class EventLogWrapper: IEventLog
    {
        private EventLog eventLog;

        public const string SOURCE = "JiraAnalysis.ReplicationService";
        public const string LOGNAME = "FJ.JiraAnalysis";

        public EventLogWrapper()
        {
            eventLog = new EventLog(LOGNAME);
            eventLog.Source = SOURCE;
            eventLog.MaximumKilobytes = 105024; // TODO: move to config file
        }
        public EventLogWrapper(string _logname, string _source)
        {
            eventLog = new EventLog(_logname);
            eventLog.Source = _source;
        }

        public void WriteEntry(string message, EventLogEntryType eventLogEntryType)
        {
            eventLog.WriteEntry(message, eventLogEntryType);
        }

        public void Clear()
        {
            eventLog.Clear();
        }
    }
}
